<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

	<head>
		<title>Contact Us - NEOWIZ INTERNET Vietnam</title>
		<meta http-equiv="content-type" content="text/HTML; charset=UTF-8" />
		<link rel="icon" href="logo.ico" type="../image/x-icon" />
		<link rel="stylesheet" type="text/css" href="../Styles/Neowiz.css">
		<link rel="stylesheet" type="text/css" href="../Styles/Scollbar.css">
		<!--<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>-->
		<script type="text/javascript" src="../JQuery/jquery.min.js"></script>
		<script type="text/javascript" src="../JQuery/vadilation.js"></script>
		<script type="text/javascript" src="../JQuery/jquery.tinyscrollbar.min.js"></script>
		<script type="text/javascript" src="../JQuery/autoresize.jquery.min.js"></script>
		<script type="text/javascript">
			$(document).ready(function(){
				//var margintop=$(window).height()/2-$("#body-sc").height() / 2;
				//$("#body-sc").css({marginTop:$(window).height()/2-$("#body-sc").height() / 2});
				$('#scrollbar1').tinyscrollbar();
				$('#txtContentNIV').autoResize({
					// On resize:
					onResize : function() {
						$(this).css({opacity:0.8});
						$('#scrollbar1').tinyscrollbar();
						
					},
					// After resize:
					animateCallback : function() {
						$(this).css({opacity:1});
						$('#scrollbar1').tinyscrollbar_update('bottom');
					},
					// Quite slow animation:
					animateDuration : 300,
					// More extra space:
					extraSpace : 0
				});
			});
			
		</script>
	</head>

	<body style="background:#ebebeb;overflow: hidden;">
<div id="body-sc" style="
position: relative;
margin-left: -240px;
padding: 0px;
left: 50%;
width: 480px;">
<div id='homer' style="background:#ececec; width:480px; padding:0px">
	<div style="height:22px;width:100%;text-align:center;padding-top:8px;">
        <strong>Contact Us</strong><br/>
    </div>
	<div id="scrollbar1">
	<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
		<div class="viewport">
			 <div class="overview">
	<div style="padding:0 10px;">
    
    						<table style="width:100%;" class="contacttb">
								<tr>
									<td style="width:100px;">Name</td>
									<td>
										<input id="txtNameNIV" type="text" value=""/>
									</td>
								</tr>
								<tr>
									<td>Email</td>
									<td>
										<input id="txtEmailNIV" type="text" value=""/>
									</td>
								</tr>
								<tr>
									<td>Country</td>
									<td>
										<input id="txtCountryNIV" type="text" value=""/>
									</td>
								</tr>
								<tr>
									<td>Phone</td>
									<td>
										<input id="txtPhoneNIV" type="text" value=""/>
									</td>
								</tr>
								<tr>
									<td>Address</td>
									<td>
										<input id="txtAddressNIV" type="text" value=""/>
									</td>
								</tr>
								<tr>
									<td>Type</td>
									<td>
										<select id="cbxTypeNIV">
											<optgroup label="Select Type">
												<option value="develop">We develop games.</option>
												<option value="publish">We publish games.</option>
												<option value="payment">We have payment systems.</option>
												<option value="question">We have questions.</option>
											</optgroup>
										</select>
									</td>
								</tr>
								<tr>
									<td colspan="2" >Content</td>
								</tr>
								<tr>
									<td colspan="2">
										<div style="padding:0px">
											<textarea rows="8" id="txtContentNIV" style="width:100%;margin:0;padding:0; resize: none; overflow-y: hidden; opacity: 0.8;"></textarea>
										</div>
									</td>
								</tr>
								<tr>
									<td colspan="2" id="contact_errmsgNIV">
									</td>
								</tr>
								
							</table>
			
    </div>
    </div></div></div>
    <div style="height:28px;width:100%;text-align:center;padding-top:8px;">
        <input id="btnContact_SubmitNIV" type="button" value="Submit" style="height:24px;width:100px;font-size:11px;"/>
        <input class="loaddingNIV" type="button" value="Waitting..." style="background: url(../Images/ajax-loader1-2.gif) no-repeat 4px 50%;height:24px;width:100px;font-size:11px;display:none;"/>
        <a  class='contnact_finishNIV modalCloseImg simplemodal-close' style='position: initial;background:none;display:none;;cursor: pointer;'>Contact Sussess.Click here to close this Popup.</a>
        <input id="btnContact_CancelNIV" class="modalCloseImg simplemodal-close" type="button" value="Cancel" style="height:24px;width:100px;font-size:11px;"/>
    </div>
</div>
<script>
$(".contnact_finishNIV,#btnContact_CancelNIV").click(
	function(){
		window.close()
	}
);
$("#btnContact_SubmitNIV").click(
		function(){
			
			if(!_FcheckFilled($("#txtNameNIV").val())){$("#txtNameNIV").focus();return;}
			if(!_FcheckFilled($("#txtEmailNIV").val())){$("#txtEmailNIV").focus();return;}
			if(!_FcheckEmail($("#txtEmailNIV").val())){$("#txtEmailNIV").focus();return;}
			if(!_FcheckFilled($("#txtCountryNIV").val())){$("#txtCountryNIV").focus();return;}
			if(!_FcheckFilled($("#txtPhoneNIV").val())){$("#txtPhoneNIV").focus();return;}
			if(!_FcheckFilled($("#txtAddressNIV").val())){$("#txtAddressNIV").focus();return;}
			if(!_FcheckFilled($("#txtContentNIV").val())){$("#txtContentNIV").focus();return;}
			$(".loaddingNIV").show();
			$("#btnContact_SubmitNIV").hide();
			$("#btnContact_CancelNIV").hide();
			var surl="../Controller/_ContactController.php";
			var sdata={
				"Controller":"ContactController",
				"action":"insertContact",
				"name": (Trim($("#txtNameNIV").val())),
				"email": (Trim($("#txtEmailNIV").val())),
				"country": (Trim($("#txtCountryNIV").val())),
				"phone": (Trim($("#txtPhoneNIV").val())),
				"address": (Trim($("#txtAddressNIV").val())),
				"type": (Trim($("#cbxTypeNIV").val())),
				"content": (Trim($("#txtContentNIV").val()))
			};
			jQuery.ajax({
				type:"POST", 
				data:sdata, 
				dataType:"text", 
				url:surl, 
				success: function (data){ 
					if(data=="true"){
						$("#contact_errmsgNIV").html("");
						//$(".ajax").colorbox();
						$(".loaddingNIV").hide();
						$(".contnact_finishNIV").show();
					}else{
						$("#contact_errmsgNIV").html("Fail. Please, try again!");
						$(".loaddingNIV").hide();
						$("#btnContact_SubmitNIV").show();
						$("#btnContact_CancelNIV").show();
					}
					$('#scrollbar1').tinyscrollbar();
					$('#scrollbar1').tinyscrollbar_update('bottom');
				},
				error: function (xhr, ajaxOptions, thrownError){
					//$("#err_msg001").append("<li><b>Status</b>:"+xhr.status+"<br/><b>ThrownError</b>:"+thrownError+"</li>");
					$("#contact_errmsgNIV").html("Fail. Please, try again!");
					$(".loaddingNIV").hide();
					$("#btnContact_SubmitNIV").show();
					$("#btnContact_CancelNIV").show();
					$('#scrollbar1').tinyscrollbar();
					$('#scrollbar1').tinyscrollbar_update('bottom');
				}
			});
		}
	);
</script>
</div>
</body>
</html>